﻿using System;
using System.Collections.Generic;
using System.Text;
using Portal.Entity;

namespace Portal.Interface
{
    /// <summary>
    /// 组织架构接口
    /// </summary>
    public interface IOrg
    {
        /// <summary>
        /// 获取所有的组织架构
        /// </summary>
        /// <returns></returns>
        List<ResourceEntity> GetOrgList();

        /// <summary>
        /// 查找组织
        /// </summary>
        /// <param name="orgName">组织名称</param>
        /// <returns></returns>
        List<ResourceEntity> FindOrg(string orgName);

        /// <summary>
        /// 获取用户列表
        /// </summary>
        /// <param name="orgId">组织Id</param>
        /// <returns></returns>
        List<UserEntity> GetUserList(string orgId);

        /// <summary>
        /// 获取用户列表
        /// </summary>
        /// <param name="orgId">组织Id</param>
        /// <param name="jobFunction">岗位</param>
        /// <returns></returns>
        List<UserEntity> GetUserList(string orgId, string jobFunction);

        /// <summary>
        /// 获取用户
        /// </summary>
        /// <param name="loginName"></param>
        /// <returns></returns>
        UserEntity GetUserEntity(string loginName);
        UserEntity GetUserEntityByID(string userID);
        
        /// <summary>
        /// 查找用户
        /// </summary>
        /// <param name="loginName">登录名</param>
        /// <param name="name">姓名</param>
        /// <returns></returns>
        List<UserEntity> FindUser(string loginName,string name);

        /// <summary>
        /// 校验用户密码
        /// </summary>
        /// <param name="loginName"></param>
        /// <param name="password"></param>
        /// <returns></returns>
        bool CheckUser(string loginName,string password);

        /// <summary>
        /// 获取系统登录的域名
        /// </summary>
        /// <returns></returns>
        List<string> GetDomains();

        /// <summary>
        /// 获取用户所有的组
        /// </summary>
        /// <returns></returns>
        List<ResourceEntity> GetUserGroups(string loginName);

        /// <summary>
        /// 获取用户所有的部门
        /// </summary>
        /// <param name="loginName"></param>
        /// <returns></returns>
        List<ResourceEntity> GetUserDepartments(string loginName);

    }
}
